/**
 * Created by Cake on 2017/5/27.
 */

$(function () {

    var square = $('header').height() + $('footer').height();
    $('section').loadScroller({
        square: square,
        scrollOver: function () {
            console.log(1);
            scrollFlag = true;
        }
    });

    var domSelect = $('.select');
    if (domSelect.length > 0) {
        domSelect.mobiscroll().select({
            theme: 'mobiscroll',
            mode: 'scroller',
            display: 'bottom',
            lang: 'zh',
            placeholder: '请选择地区',
            headerText:"地区",
            onInit: function() {
                domSelect
                    .val('')
                    .prev().val('');
            }
        });
    }

    var domPlace = $('.place');
    if (domPlace.length > 0) {
        domPlace.mobiscroll().select({
            theme: 'mobiscroll',
            mode: 'scroller',
            display: 'bottom',
            lang: 'zh',
            placeholder: '请选择地区',
            headerText:"地区",
            onInit: function() {
                domPlace
                    .val('')
                    .prev().val('');
            }
        });
    }

    var domPlace = $('.company');
    if (domPlace.length > 0) {
        domPlace.mobiscroll().select({
            theme: 'mobiscroll',
            mode: 'scroller',
            display: 'bottom',
            lang: 'zh',
            placeholder: '请选择公司规模',
            headerText:"公司规模",
            onInit: function() {
                domPlace
                    .val('')
                    .prev().val('');
            }
        });
    }

    var domPlace = $('.type');
    if (domPlace.length > 0) {
        domPlace.mobiscroll().select({
            theme: 'mobiscroll',
            mode: 'scroller',
            display: 'bottom',
            lang: 'zh',
            placeholder: '请选择供货商类型',
            headerText:"供货商类型",
            onInit: function() {
                domPlace
                    .val('')
                    .prev().val('');
            }
        });
    }

});